function Enter_Code(data) {
	var buffer = new StringBuffer();
	buffer.append('<div class="account">');
	buffer.append('<div class="logintext"><font>您的账号属于多个公司，请选择其中1个进行登陆</font></div>');
		$.each(data,function(i,info)
		{
			buffer.append('<div class="logintext"><div class="tip">'+info.ComName+'</div><div class="text"><img userid="'+info.ID+'" comid="'+info.ComID+'" src="img/dui'+(i==0?2:1)+'.png"/></div></div>');
		});
		buffer.append('<div class="enter"><button id="enter" class="button blue">进入</button></div>');
		buffer.append('</div>');
	return buffer.toString();
};


function Init_Enter(data){
	$("body").html(Enter_Code(data));
	$(".account .logintext").each(function(i,info){
		info.addEventListener("tap",function(){
			$(".account img").attr("src","img/dui1.png");
    		$(this).find("img").attr("src","img/dui2.png");
    	});
	});
	
    get("enter").addEventListener("tap",function(){
    			var client = plus.push.getClientInfo();
	            var data = {};
	            data.act = "Enter";
	            data.username = plus.storage.getItem("crm_username");
	            data.userpwd = plus.storage.getItem("crm_userpwd");
	            data.id = $(".account img[src='img/dui2.png']").attr("userid");
	            data.comid=$(".account img[src='img/dui2.png']").attr("comid");
      			data.source=source;
      			data.version=version;
      			data.clientid=client.clientid;
      			data.token=client.token;
      			data.editions=editions;
      			data.sign=GetSign(data.act);
      			plus.nativeUI.showWaiting( "正在进入..." );
      			CloseWaiting(10000);
      			mui.getJSON(login_domain, data, function(json){
      				plus.nativeUI.closeWaiting();
      				plus.nativeUI.toast(json.msg);
      				if(json.state)
      				{
                        plus.storage.setItem("crm_userid",data.id.toString());
                        plus.storage.setItem("crm_comid",data.comid.toString());
                        plus.storage.setItem("crm_user",JSON.stringify(User));
                        userid=data.id;
	                    comid=data.comid;
	                    User=json.data;
      					Init_Main();
      					Init_AddCRM();
      					Init_AddOA();
      					Init_AddHR();
      				}else{
      					
      				}
      				
      			});
    });
};